<?php

namespace App\Http\Requests\Api\v1;

class RechargeRequest extends FormRequest
{
    public function rules()
    {
        switch ($this->method()) {
            case 'POST':
                return [
                    'code_id' => 'numeric|gt:0',
                    'amount'     => 'required|numeric|min:1',
                    //'recharge_address'     => 'required',
                ];
                break;
            case 'PATCH':
                return [
                    //'payment_id' => 'required|numeric|gt:0',
                    //'amount'     => 'required|numeric|min:1',
                    'recharge_address'     => 'required',
                ];
                break;
            case 'GET':
                return [
                    'page' => 'numeric|min:1',
                    'limit' => 'numeric|min:1',
                    'date' => 'date|after:2019-12|before:tomorrow',
                ];
                break;
        }

    }

}
